package com.design.cjm.behavioral.memento.example1;

/**
 * @Author: Jie Ming Chen
 * @Date: 2018/9/24
 * @Version 1.0
 */
public class Originator {

    private String state;

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public Memento createMemento() {

        return new Memento(state);
    }

    public void setMemento(Memento memento) {

        state = memento.state;
    }

    public void show() {
        System.out.println("state=" + state);
    }

}
